Optimal. Leaf size=245 \[ -\frac {a^2}{2 d (c+d x)^2}-\frac {a b f^2 \text {Ci}\left (x f+\frac {c f}{d}\right ) \sin \left (e-\frac {c f}{d}\right )}{d^3}-\frac {a b f^2 \cos \left (e-\frac {c f}{d}\right ) \text {Si}\left (x f+\frac {c f}{d}\right )}{d^3}-\frac {a b f \cos (e+f x)}{d^2 (c+d x)}-\frac {a b \sin (e+f x)}{d (c+d x)^2}+\frac {b^2 f^2 \text {Ci}\left (2 x f+\frac {2 c f}{d}\right ) \cos \left (2 e-\frac {2 c f}{d}\right )}{d^3}-\frac {b^2 f^2 \sin \left (2 e-\frac {2 c f}{d}\right ) \text {Si}\left (2 x f+\frac {2 c f}{d}\right )}{d^3}-\frac {b^2 f \sin (e+f x) \cos (e+f x)}{d^2 (c+d x)}-\frac {b^2 \sin ^2(e+f x)}{2 d (c+d x)^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.42, antiderivative size = 245, normalized size of antiderivative = 1.00, number of steps used = 14, number of rules used = 8, integrand size = 20, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.400, Rules used = {3317, 3297, 3303, 3299, 3302, 3314, 31, 3312} \[ -\frac {a^2}{2 d (c+d x)^2}-\frac {a b f^2 \text {CosIntegral}\left (\frac {c f}{d}+f x\right ) \sin \left (e-\frac {c f}{d}\right )}{d^3}-\frac {a b f^2 \cos \left (e-\frac {c f}{d}\right ) \text {Si}\left (x f+\frac {c f}{d}\right )}{d^3}-\frac {a b f \cos (e+f x)}{d^2 (c+d x)}-\frac {a b \sin (e+f x)}{d (c+d x)^2}+\frac {b^2 f^2 \text {CosIntegral}\left (\frac {2 c f}{d}+2 f x\right ) \cos \left (2 e-\frac {2 c f}{d}\right )}{d^3}-\frac {b^2 f^2 \sin \left (2 e-\frac {2 c f}{d}\right ) \text {Si}\left (2 x f+\frac {2 c f}{d}\right )}{d^3}-\frac {b^2 f \sin (e+f x) \cos (e+f x)}{d^2 (c+d x)}-\frac {b^2 \sin ^2(e+f x)}{2 d (c+d x)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 31
Rule 3297
Rule 3299
Rule 3302
Rule 3303
Rule 3312
Rule 3314
Rule 3317
Rubi steps
\begin {align*} \int \frac {(a+b \sin (e+f x))^2}{(c+d x)^3} \, dx &=\int \left (\frac {a^2}{(c+d x)^3}+\frac {2 a b \sin (e+f x)}{(c+d x)^3}+\frac {b^2 \sin ^2(e+f x)}{(c+d x)^3}\right ) \, dx\\ &=-\frac {a^2}{2 d (c+d x)^2}+(2 a b) \int \frac {\sin (e+f x)}{(c+d x)^3} \, dx+b^2 \int \frac {\sin ^2(e+f x)}{(c+d x)^3} \, dx\\ &=-\frac {a^2}{2 d (c+d x)^2}-\frac {a b \sin (e+f x)}{d (c+d x)^2}-\frac {b^2 f \cos (e+f x) \sin (e+f x)}{d^2 (c+d x)}-\frac {b^2 \sin ^2(e+f x)}{2 d (c+d x)^2}+\frac {(a b f) \int \frac {\cos (e+f x)}{(c+d x)^2} \, dx}{d}+\frac {\left (b^2 f^2\right ) \int \frac {1}{c+d x} \, dx}{d^2}-\frac {\left (2 b^2 f^2\right ) \int \frac {\sin ^2(e+f x)}{c+d x} \, dx}{d^2}\\ &=-\frac {a^2}{2 d (c+d x)^2}-\frac {a b f \cos (e+f x)}{d^2 (c+d x)}+\frac {b^2 f^2 \log (c+d x)}{d^3}-\frac {a b \sin (e+f x)}{d (c+d x)^2}-\frac {b^2 f \cos (e+f x) \sin (e+f x)}{d^2 (c+d x)}-\frac {b^2 \sin ^2(e+f x)}{2 d (c+d x)^2}-\frac {\left (a b f^2\right ) \int \frac {\sin (e+f x)}{c+d x} \, dx}{d^2}-\frac {\left (2 b^2 f^2\right ) \int \left (\frac {1}{2 (c+d x)}-\frac {\cos (2 e+2 f x)}{2 (c+d x)}\right ) \, dx}{d^2}\\ &=-\frac {a^2}{2 d (c+d x)^2}-\frac {a b f \cos (e+f x)}{d^2 (c+d x)}-\frac {a b \sin (e+f x)}{d (c+d x)^2}-\frac {b^2 f \cos (e+f x) \sin (e+f x)}{d^2 (c+d x)}-\frac {b^2 \sin ^2(e+f x)}{2 d (c+d x)^2}+\frac {\left (b^2 f^2\right ) \int \frac {\cos (2 e+2 f x)}{c+d x} \, dx}{d^2}-\frac {\left (a b f^2 \cos \left (e-\frac {c f}{d}\right )\right ) \int \frac {\sin \left (\frac {c f}{d}+f x\right )}{c+d x} \, dx}{d^2}-\frac {\left (a b f^2 \sin \left (e-\frac {c f}{d}\right )\right ) \int \frac {\cos \left (\frac {c f}{d}+f x\right )}{c+d x} \, dx}{d^2}\\ &=-\frac {a^2}{2 d (c+d x)^2}-\frac {a b f \cos (e+f x)}{d^2 (c+d x)}-\frac {a b f^2 \text {Ci}\left (\frac {c f}{d}+f x\right ) \sin \left (e-\frac {c f}{d}\right )}{d^3}-\frac {a b \sin (e+f x)}{d (c+d x)^2}-\frac {b^2 f \cos (e+f x) \sin (e+f x)}{d^2 (c+d x)}-\frac {b^2 \sin ^2(e+f x)}{2 d (c+d x)^2}-\frac {a b f^2 \cos \left (e-\frac {c f}{d}\right ) \text {Si}\left (\frac {c f}{d}+f x\right )}{d^3}+\frac {\left (b^2 f^2 \cos \left (2 e-\frac {2 c f}{d}\right )\right ) \int \frac {\cos \left (\frac {2 c f}{d}+2 f x\right )}{c+d x} \, dx}{d^2}-\frac {\left (b^2 f^2 \sin \left (2 e-\frac {2 c f}{d}\right )\right ) \int \frac {\sin \left (\frac {2 c f}{d}+2 f x\right )}{c+d x} \, dx}{d^2}\\ &=-\frac {a^2}{2 d (c+d x)^2}-\frac {a b f \cos (e+f x)}{d^2 (c+d x)}+\frac {b^2 f^2 \cos \left (2 e-\frac {2 c f}{d}\right ) \text {Ci}\left (\frac {2 c f}{d}+2 f x\right )}{d^3}-\frac {a b f^2 \text {Ci}\left (\frac {c f}{d}+f x\right ) \sin \left (e-\frac {c f}{d}\right )}{d^3}-\frac {a b \sin (e+f x)}{d (c+d x)^2}-\frac {b^2 f \cos (e+f x) \sin (e+f x)}{d^2 (c+d x)}-\frac {b^2 \sin ^2(e+f x)}{2 d (c+d x)^2}-\frac {a b f^2 \cos \left (e-\frac {c f}{d}\right ) \text {Si}\left (\frac {c f}{d}+f x\right )}{d^3}-\frac {b^2 f^2 \sin \left (2 e-\frac {2 c f}{d}\right ) \text {Si}\left (\frac {2 c f}{d}+2 f x\right )}{d^3}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 1.30, size = 395, normalized size = 1.61 \[ -\frac {2 a^2 d^2+4 a b c^2 f^2 \cos \left (e-\frac {c f}{d}\right ) \text {Si}\left (f \left (\frac {c}{d}+x\right )\right )+4 a b f^2 (c+d x)^2 \text {Ci}\left (f \left (\frac {c}{d}+x\right )\right ) \sin \left (e-\frac {c f}{d}\right )+4 a b d^2 f^2 x^2 \cos \left (e-\frac {c f}{d}\right ) \text {Si}\left (f \left (\frac {c}{d}+x\right )\right )+8 a b c d f^2 x \cos \left (e-\frac {c f}{d}\right ) \text {Si}\left (f \left (\frac {c}{d}+x\right )\right )+4 a b c d f \cos (e+f x)+4 a b d^2 \sin (e+f x)+4 a b d^2 f x \cos (e+f x)+4 b^2 c^2 f^2 \sin \left (2 e-\frac {2 c f}{d}\right ) \text {Si}\left (\frac {2 f (c+d x)}{d}\right )-4 b^2 f^2 (c+d x)^2 \text {Ci}\left (\frac {2 f (c+d x)}{d}\right ) \cos \left (2 e-\frac {2 c f}{d}\right )+4 b^2 d^2 f^2 x^2 \sin \left (2 e-\frac {2 c f}{d}\right ) \text {Si}\left (\frac {2 f (c+d x)}{d}\right )+8 b^2 c d f^2 x \sin \left (2 e-\frac {2 c f}{d}\right ) \text {Si}\left (\frac {2 f (c+d x)}{d}\right )+2 b^2 c d f \sin (2 (e+f x))+2 b^2 d^2 f x \sin (2 (e+f x))-b^2 d^2 \cos (2 (e+f x))+b^2 d^2}{4 d^3 (c+d x)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.84, size = 467, normalized size = 1.91 \[ \frac {b^{2} d^{2} \cos \left (f x + e\right )^{2} - {\left (a^{2} + b^{2}\right )} d^{2} + 2 \, {\left (b^{2} d^{2} f^{2} x^{2} + 2 \, b^{2} c d f^{2} x + b^{2} c^{2} f^{2}\right )} \sin \left (-\frac {2 \, {\left (d e - c f\right )}}{d}\right ) \operatorname {Si}\left (\frac {2 \, {\left (d f x + c f\right )}}{d}\right ) - 2 \, {\left (a b d^{2} f^{2} x^{2} + 2 \, a b c d f^{2} x + a b c^{2} f^{2}\right )} \cos \left (-\frac {d e - c f}{d}\right ) \operatorname {Si}\left (\frac {d f x + c f}{d}\right ) - 2 \, {\left (a b d^{2} f x + a b c d f\right )} \cos \left (f x + e\right ) + {\left ({\left (b^{2} d^{2} f^{2} x^{2} + 2 \, b^{2} c d f^{2} x + b^{2} c^{2} f^{2}\right )} \operatorname {Ci}\left (\frac {2 \, {\left (d f x + c f\right )}}{d}\right ) + {\left (b^{2} d^{2} f^{2} x^{2} + 2 \, b^{2} c d f^{2} x + b^{2} c^{2} f^{2}\right )} \operatorname {Ci}\left (-\frac {2 \, {\left (d f x + c f\right )}}{d}\right )\right )} \cos \left (-\frac {2 \, {\left (d e - c f\right )}}{d}\right ) - 2 \, {\left (a b d^{2} + {\left (b^{2} d^{2} f x + b^{2} c d f\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right ) + {\left ({\left (a b d^{2} f^{2} x^{2} + 2 \, a b c d f^{2} x + a b c^{2} f^{2}\right )} \operatorname {Ci}\left (\frac {d f x + c f}{d}\right ) + {\left (a b d^{2} f^{2} x^{2} + 2 \, a b c d f^{2} x + a b c^{2} f^{2}\right )} \operatorname {Ci}\left (-\frac {d f x + c f}{d}\right )\right )} \sin \left (-\frac {d e - c f}{d}\right )}{2 \, {\left (d^{5} x^{2} + 2 \, c d^{4} x + c^{2} d^{3}\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.04, size = 374, normalized size = 1.53 \[ \frac {-\frac {a^{2} f^{3}}{2 \left (\left (f x +e \right ) d +c f -d e \right )^{2} d}+2 f^{3} a b \left (-\frac {\sin \left (f x +e \right )}{2 \left (\left (f x +e \right ) d +c f -d e \right )^{2} d}+\frac {-\frac {\cos \left (f x +e \right )}{\left (\left (f x +e \right ) d +c f -d e \right ) d}-\frac {\frac {\Si \left (f x +e +\frac {c f -d e}{d}\right ) \cos \left (\frac {c f -d e}{d}\right )}{d}-\frac {\Ci \left (f x +e +\frac {c f -d e}{d}\right ) \sin \left (\frac {c f -d e}{d}\right )}{d}}{d}}{2 d}\right )-\frac {f^{3} b^{2}}{4 \left (\left (f x +e \right ) d +c f -d e \right )^{2} d}-\frac {f^{3} b^{2} \left (-\frac {\cos \left (2 f x +2 e \right )}{\left (\left (f x +e \right ) d +c f -d e \right )^{2} d}-\frac {-\frac {2 \sin \left (2 f x +2 e \right )}{\left (\left (f x +e \right ) d +c f -d e \right ) d}+\frac {\frac {4 \Si \left (2 f x +2 e +\frac {2 c f -2 d e}{d}\right ) \sin \left (\frac {2 c f -2 d e}{d}\right )}{d}+\frac {4 \Ci \left (2 f x +2 e +\frac {2 c f -2 d e}{d}\right ) \cos \left (\frac {2 c f -2 d e}{d}\right )}{d}}{d}}{d}\right )}{4}}{f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [C] time = 0.72, size = 474, normalized size = 1.93 \[ -\frac {\frac {32 \, a^{2} f^{3}}{{\left (f x + e\right )}^{2} d^{3} + d^{3} e^{2} - 2 \, c d^{2} e f + c^{2} d f^{2} - 2 \, {\left (d^{3} e - c d^{2} f\right )} {\left (f x + e\right )}} - \frac {64 \, {\left (f^{3} {\left (-i \, E_{3}\left (\frac {i \, {\left (f x + e\right )} d - i \, d e + i \, c f}{d}\right ) + i \, E_{3}\left (-\frac {i \, {\left (f x + e\right )} d - i \, d e + i \, c f}{d}\right )\right )} \cos \left (-\frac {d e - c f}{d}\right ) + f^{3} {\left (E_{3}\left (\frac {i \, {\left (f x + e\right )} d - i \, d e + i \, c f}{d}\right ) + E_{3}\left (-\frac {i \, {\left (f x + e\right )} d - i \, d e + i \, c f}{d}\right )\right )} \sin \left (-\frac {d e - c f}{d}\right )\right )} a b}{{\left (f x + e\right )}^{2} d^{3} + d^{3} e^{2} - 2 \, c d^{2} e f + c^{2} d f^{2} - 2 \, {\left (d^{3} e - c d^{2} f\right )} {\left (f x + e\right )}} - \frac {{\left (16 \, f^{3} {\left (E_{3}\left (\frac {2 i \, {\left (f x + e\right )} d - 2 i \, d e + 2 i \, c f}{d}\right ) + E_{3}\left (-\frac {2 i \, {\left (f x + e\right )} d - 2 i \, d e + 2 i \, c f}{d}\right )\right )} \cos \left (-\frac {2 \, {\left (d e - c f\right )}}{d}\right ) + f^{3} {\left (16 i \, E_{3}\left (\frac {2 i \, {\left (f x + e\right )} d - 2 i \, d e + 2 i \, c f}{d}\right ) - 16 i \, E_{3}\left (-\frac {2 i \, {\left (f x + e\right )} d - 2 i \, d e + 2 i \, c f}{d}\right )\right )} \sin \left (-\frac {2 \, {\left (d e - c f\right )}}{d}\right ) - 16 \, f^{3}\right )} b^{2}}{{\left (f x + e\right )}^{2} d^{3} + d^{3} e^{2} - 2 \, c d^{2} e f + c^{2} d f^{2} - 2 \, {\left (d^{3} e - c d^{2} f\right )} {\left (f x + e\right )}}}{64 \, f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.00 \[ \int \frac {{\left (a+b\,\sin \left (e+f\,x\right )\right )}^2}{{\left (c+d\,x\right )}^3} \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\left (a + b \sin {\left (e + f x \right )}\right )^{2}}{\left (c + d x\right )^{3}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________